﻿using System.Linq;
using CardPlay.Model.Primitives;

namespace CardPlay.Model.CardModel
{
    public static class Extensions
    {
        public static SuitColor Color(this Suit suit)
        {
            return (suit == Suit.Spades || suit == Suit.Clubs) ? SuitColor.Black : SuitColor.Red;
        }

        public static Suit[] MatchingSuits(this SuitColor color)
        {
            return Enum<Suit>.Values.Where(suit => suit.Color() == color).ToArray();
        }
    }
}
